#include <iostream>
#include <vector>
#include <cstring>
using namespace std;
const int N = 200;
int k, n, m;
int a[N], b[N];

int main() {
	int t;
	cin >> t;
	while (t--) {
		memset(a, 0x3f, sizeof a);
		memset(b, 0x3f, sizeof b);
		vector<int> v;
		cin >> k >> n >> m;
		for (int i = 0; i < n; i++)
			cin >> a[i];
		for (int j = 0; j < m; j++)
			cin >> b[j];
		int p1 = 0, p2 = 0;
		int cnt = 0;
		int op = 0;
		while (cnt <= n + m) {
			cnt++;
			if (a[p1] == 0) {
				v.push_back(a[p1]);
				p1++, k++;
				continue;
			}
			if (b[p2] == 0) {
				v.push_back(b[p2]);
				p2++, k++;
				continue;
			}
			if (a[p1] <= k) {
				v.push_back(a[p1]);
				p1++;
				continue;
			}
			if (b[p2] <= k) {
				v.push_back(b[p2]);
				p2++;
				continue;
			}
			if (a[p1] > k && p1 < n) {
				op = 1;
				break;
			}
			if (b[p2] > k && p2 < m) {
				op = 1;
				break;
			}
		}
		if (op == 1)
			cout << -1 << endl;
		else {
			for (auto e : v)
				cout << e << " ";
			cout << endl;
		}
	}
	return 0;
}

